<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
require_once("../conn.php");

$code = $_POST['code'];
$num = $_POST['num'];

$db = new DBC();
$size = count($code);
for ($i = 0; $i < $size; $i++) {
    if ($code[$i] != "") {
        $sql = "UPDATE t_animation SET num = " . $num[$i] . " WHERE flashcode = '" . $code[$i] . "'";
        $db->execute($sql);
    }
}
$transfer = "animationList.php?menu=animation";
echo "<script language='javascript'>location='" . $transfer . "';</script>";

function checkTrim($item) {
    if (isset($item)) {
        $item = trim($item);
    } else {
        $item = "";
    }
    return $item;
}
?>
